#include "bomberlib.hh"
#include "Bomberman.hh"
#include <iostream>

namespace Model
{
  void Bomberman::initialize(void)
  {
    this->model_ = gdl::Model::load("models/marvin.fbx");
  }
  void Bomberman::update(gdl::GameClock const & gameClock, gdl::Input & input)
  {
    this->model_.update(gameClock);
   
    if (input.isKeyDown(gdl::Keys::P) == true)
      this->model_.play("Take 001");
    if (input.isKeyDown(gdl::Keys::Right) == true)
      this->rotation_.y = ((int)rotation_.y + 90) % 360;
    if (input.isKeyDown(gdl::Keys::Left) == true)
      this->rotation_.y = ((int)rotation_.y - 90) % 360;
  }
  void Bomberman::draw(void)
  {
    gdl::Model::Begin();

    this->model_.draw();
   
    gdl::Model::End();
  }
}
